/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package c06_herencies_pila;

/**
 *
 * @author Monica
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
        // TODO code application logic here
        Object node1 = "node1";
        Object node2= "node2";
        Object node3 = "node3";
        Object node4 = "node4";
        Object node5 = "node5";

        MyPila pile = new MyPila();
        pile.apilar(node1);
        pile.apilar(node2);
        pile.apilar(node3);
        pile.apilar(node4);
        pile.apilar(node5);
        System.out.println(" Apilant node " + pile.cim());

        for(int i = 0; i < 10; i++)
        pile.apilar( new Integer(i+1) );
        pile.apilar(new String ("Aixo desapila"));


         System.out.print("\n\tContingut : \n");
        try {
        for( ; ; ) {
            System.out.print(" Estic desapilant " + pile.cim( )+ "\n");
            pile.desapilar();
            }
         }
            catch(Exception e){ }
         System.out.println( );
        }
    }


